﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PeoplesJukebox.Core.MediaItems.Bases;
using PeoplesJukebox.Core.Enums;
using System.Runtime.Serialization;

namespace PeoplesJukebox.Core.MediaItems
{
    /// <summary>
    /// Represents a track
    /// </summary>
    [KnownType(typeof(MediaItem))]
    [DataContract]
    public class Track : MediaItem
    {
        /// <summary>
        /// Default constructor
        /// </summary>
        public Track() { }

        /// <summary>
        /// Gets the <see cref="Album"/> of the track
        /// </summary>
        public Album Album
        {
            get { return Container.Catalogue.GetAlbum(this.ParentId); }
        }

        /// <summary>
        /// Gets the <see cref="Artist"/> of the track
        /// </summary>
        public Artist Artist
        {
            get { return this.Album.Artist; }
        }

        /// <summary>
        /// Gets the item type
        /// </summary>
        public override MediaItemType ItemType
        {
            get { return MediaItemType.Track; }
            set { }
        }
    }
}
